package com.feri.findlife.vo;

/**
 * @program: FindLife
 * @description:
 * @author: Feri(邢朋辉)
 * @create: 2020-12-21 15:42
 */
public class R {
    private int code;//状态码
    private String msg;//说明信息
    private Object data;//数据

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public R(){

    }
    public R(int c, String m, Object o){
        code=c;
        msg=m;
        data=o;
    }

    /**
     * 快速方便的构建对象*/
    public static R ok(){
        return new R(1,"OK",null);
    }
    public static R ok(Object obj){
        return new R(1,"OK",obj);
    }
    public static R fail(){
        return new R(2,"Fail",null);
    }
    public static R fail(String msg){
        return new R(2,msg,null);
    }
}
